#include <iostream>
#include <string>
#include <stack>



using namespace std;

int main() {
    
//STACK LOGIC
	stack<int> myStack;

	//push values onto the stack
	myStack.push(10);
	myStack.push(20);
	myStack.push(30);

	//see the top value
	cout << "top is: " << myStack.top()<<endl;

	cout<<endl<<myStack.size()<<endl; //tells you how many items are in the stack

	//display and pop elements from the stack
	cout << endl << "Stack elements (from top to bottom):" << endl;
	while (!myStack.empty()) {
		cout << myStack.top() << endl; //view the top value
		myStack.pop(); //remove the top value
	}

	return 0;
}
